﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace T.FAS.Runtime.Metadata.Entity.DataModel
{
    public class TEvent : ICloneable
    {
        /// <summary>
        /// 主键id
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 所属状态机ID
        /// </summary>
        [JsonIgnore]
        public string StateMachineID { get; set; }

        /// <summary>
        /// 事件标识
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 事件名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 前置条件表达式内容
        /// </summary>
        public string PreconditionExpression { get; set; }

        /// <summary>
        /// 前置条件表达式内容Json内容，供表达式SDK使用
        /// </summary>
        public string PreconditionExpressionJson { get; set; }

        /// <summary>
        /// 事件描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 0:不启用权限控制，1:启用权限控制
        /// </summary>
        public bool IsPermissionControl { get; set; }

        /// <summary>
        /// 状态机事件权限控制设置信息
        /// </summary>
        // Todo:
        // public ActionPermissionDefinitionForView StateMachineEventPermission { get; set; }

        /// <summary>
        /// 操作权限ID
        /// </summary>
        public string OPID { get; set; }

        /// <summary>
        /// 操作权限
        /// </summary>
        //Todo:
        //public BizOperation OP { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext1 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext2 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext3 { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [JsonIgnore]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>   
        [JsonIgnore]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        [JsonIgnore]
        public string LastModifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>    
        [JsonIgnore]
        public DateTime LastModifyTime { get; set; }

        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
